package cn.fntop.config;

import cn.fntop.interceptor.FeignTenantInterceptor;
import cn.fntop.interceptor.TenantRequestInterceptor;
import feign.RequestInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.client.ClientHttpRequestInterceptor;

/**
 * 租户信息拦截器注册
 */
@Configuration
public class TenantConfiguration {
    @Bean
    public RequestInterceptor feignTenantInterceptor() {
        return new FeignTenantInterceptor();
    }

    @Bean
    public ClientHttpRequestInterceptor tenantRequestInterceptor() {
        return new TenantRequestInterceptor();
    }
}
